<%-- 
    Document   : right
    Created on : Oct 6, 2011, 8:39:31 AM
    Author     : Rocker000
--%>

<%@page import="pojo.KhachHang_pojo"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<form id="form1" name="form1" method="post" action="KhachHang_controller">
    <table width="100%"  border="0" align="center" background="Image/left.jpg">

        <tr >
            <td >
                <%
                    KhachHang_pojo kh = new KhachHang_pojo();
                    if (session.getAttribute("KhachHang") != null) {
                        kh = (KhachHang_pojo) session.getAttribute("KhachHang");
                    }
                    if (session.getAttribute("IsLogin") == "True" && kh.getIsAdmin() == 1) {%>


                <!--FORM ADMIN-->
                <table width="100%" border="0" background="Image/admin.gif">
                    <tr>
                        <td width="28%" align="left">ADMIN:</td>
                        <td width="72%" align="left"><font color="red"><strong><%=kh.getTenDangNhap()%></strong></font></td>                      
                    </tr>
                    <tr>
                        <td colspan="2" align="left"><a href="thongtincanhan.jsp"><font color="yellow">Thông tin cá nhân</font></a></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="left"><a href="giohang_controller?action=view"><font color="yellow">Giỏ hàng</font></a></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="left"><a href="quanlyuser.jsp"><font color="yellow">Quản lý user</font></a></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="left"><a href="sanpham_controller?action=timkiemsanpham&&txtkey=&&cbloaisanpham=none"><font color="yellow">Quản lý sản phẩm</font></a></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="left"><a href="dondathang.jsp"><font color="yellow">Quản lý đơn đặt hàng</font></a></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="left"><a href="themsanpham.jsp"><font color="yellow">Thêm sản phẩm</font></a></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="left"><a href="thaydoimatkhau.jsp"><font color="yellow">Đổi mật khẩu</font></a></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="left"><a href="KhachHang_controller?action=dangxuat"><font color="yellow">Thoát</font></a></td>
                    </tr>
                </table>
                <!--END FORM ADMIN-->
                <%} else if (session.getAttribute("IsLogin") == "True") {%>             

                <!--FORM USER-->
                <table width="100%" border="0" background="Image/dang nhap.jpg">
                    <tr>
                        <td width="28%" align="left">Xin chào:</td>
                        <td width="72%" align="left"><font color="red"><strong><%=kh.getTenDangNhap()%></strong></font></td>                      
                    </tr>
                    <tr>
                        <td colspan="2" align="left"><a href="thongtincanhan.jsp">Thông tin cá nhân</a></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="left"><a href="giohang_controller?action=view">Giỏ hàng</a></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="left"><a href="thaydoimatkhau.jsp">Đổi mật khẩu</a></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="left"><a href="KhachHang_controller?action=dangxuat">Thoát</a></td>
                    </tr>
                </table>
                <!--END FORM USER-->
                <%} else {%>       


                <!--FORM DANG NHAP-->
                <table width="100%" border="0"  background="Image/dang nhap.jpg">

                    <tr>
                        <td width="34%" align="left">UserName:</td>
                        <td width="66%" align="left"><input type="text" name="txttendangnhap" id="txtusername" /></td>                      	                      
                    </tr>

                    <tr>
                        <td align="left">PassWord:</td>
                        <td align="left"><input type="password" name="txtmatkhau" id="txtpassword" /></td>                      
                    </tr>

                    <tr>
                        <td align="left">
                            <input type="submit" name="btdangnhap" id="btdangnhap" value="Đăng Nhập" onclick="return kiemtradangnhap();"  />
                            <input type="hidden" name="action" value="dangnhap"
                        </td>                      
                        <td align="left"><a href="DangKi.jsp?action=view"><input type="button" name="btDangki" id="btDangki" value="Đăng Kí" " /></a></td>  
                    <tr>
                        <td colspan="2">
                            <%String err = "";
                                if (request.getAttribute("err") != null) {
                                    err = String.valueOf(request.getAttribute("err"));
                                }%>
                            <strong><font color="red"><%=err%></font></strong>
                        </td>
                    </tr>

        </tr>

    </table>
    <!--END FORM DANG NHAP-->
    <%}%>            
</td>
</tr>

</table>

</form>
 
